package org.fastsyncer.common.entity;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Mapping implements Serializable{

	private static final long serialVersionUID = 7337210896115791239L;

	// 配置名称
	private String name;
	
	// 数据源配置
	private Object config;

	// 驱动类型
	private String connector;

	// 同步字段类型,例如：[{name=ID, type=4}, {name=NAME, type=12}]
	private List<Map<String, Object>> fileds;
	
	// 转换策略,例如：{"ID":["prepend":["这是前缀"],"append":["这是后缀"]],"NAME":["replace":["?","*"]]}
	private Map<String, List<Map<String, String[]>>> convertor;

	// 执行命令
	private Map<String, String> executeCommond = new HashMap<String, String>();

	// 总数据量
	private Integer rowCount;
	
	// 是否可用,不可用为false
	private boolean alive = false;

	public Mapping() {
		super();
	}

	public Mapping(String name, Object config, String connector, List<Map<String, Object>> fileds, Integer rowCount) {
		super();
		this.name = name;
		this.config = config;
		this.connector = connector;
		this.fileds = fileds;
		this.rowCount = rowCount;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Object getConfig() {
		return config;
	}

	public void setConfig(Object config) {
		this.config = config;
	}

	public String getConnector() {
		return connector;
	}

	public void setConnector(String connector) {
		this.connector = connector;
	}

	public List<Map<String, Object>> getFileds() {
		return fileds;
	}

	public void setFileds(List<Map<String, Object>> fileds) {
		this.fileds = fileds;
	}

	public Map<String, List<Map<String, String[]>>> getConvertor() {
        return convertor;
    }

    public void setConvertor(Map<String, List<Map<String, String[]>>> convertor) {
        this.convertor = convertor;
    }

    public Map<String, String> getExecuteCommond() {
		return executeCommond;
	}

	public void setExecuteCommond(Map<String, String> executeCommond) {
		this.executeCommond = executeCommond;
	}

	public Integer getRowCount() {
		return rowCount;
	}

	public void setRowCount(Integer rowCount) {
		this.rowCount = rowCount;
	}

	public boolean isAlive() {
		return alive;
	}

	public void setAlive(boolean alive) {
		this.alive = alive;
	}

}
